Report post

What is a CSS filter?

The CSS filter property provides access to effects like blur or color shifting on an element’s rendering before the element is displayed. Filters are commonly used to adjust the rendering of an image, a background, or a border. .filter-me { filter: blur(3px); filter: grayscale(1); filter: saturate(2.2); filter: none; /* remove existing filter */ }

How does a color filter work?

The filter applies a linear multiplier to the input image, making it appear brighter or darker. It accepts a decimal value between 0 and 1, or a percentage value. A value of 0 results in a completely black image. A value of 100% or 1 leaves the image as is with its original brightness level.

How does a CSS blur filter work?

The CSS blur filter applies a Gaussian blur visual effect to an element. It accepts a CSS length unit (px, rem, em, etc.) to determine how many pixels on the screen need to blend into each other to generate a blurred result. The larger the value of the CSS length unit passed to the filter, the more blur is applied to the element.

What does a grayscale filter do?

The grayscale filter removes all color information from an image and sets its color to a tone in the grayscale. It accepts a decimal value between 0 and 1, or a percentage value up to 100%. A value of 100% or 1 results in a completely gray image.

Related articles

The World's Leading Crypto Trading Platform

Get my welcome gifts